//
//  FTView.swift
//  testSwift
//
//  Created by taoge on 2018/3/21.
//  Copyright © 2018年 FT. All rights reserved.
//

import UIKit

@objc protocol FTViewDelegate :NSObjectProtocol {
    func clickButton(sender:UIButton)
}

class FTView: UIView {

    @IBOutlet weak var myLable: UILabel!
    @IBOutlet weak var myButton: UIButton!
    weak var delegate : FTViewDelegate?
    
    
    static func newInstance() -> FTView?{
        let nibView = Bundle.main.loadNibNamed("FTView", owner: nil, options: nil)
        if let view = nibView?.first as? FTView{
            return view
        }
        return nil
    }
    override func awakeFromNib() {
        super.awakeFromNib()
       myLable.text = "0008888"
        
    }
   
    @IBAction func click(_ sender: Any) {
        delegate?.clickButton(sender: sender as! UIButton)
    }
    
}
